package com.yidu.BusinessData.mapper;

;
import com.yidu.BusinessData.entity.StockEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
/**@description: 板块分类Mapper
 *@author: 肖理
 *@create: 2022-09-10
 **/
@Repository
public interface StockMapper {//limit #{page},#{limit}
    @Select("select * from stock where stockName like CONCAT('%',#{stockName},'%')")
    List<StockEntity> selectStock(Map map);
    @Select("select * from stock where stockFatherId = '000'")
    List<StockEntity> selectStocktwo();
    @Select("select * from stock where stockFatherId != '000'")
    List<StockEntity> selectStockthree();
    @Insert("insert into stock value(#{stockId},#{stockName},#{stockFatherId},#{stockType})")
    int insertStock(StockEntity stockEntity);
    @Delete("delete from stock where stockId=#{stockId}")
    int deleteStock(String stockId);
    @Update("update stock set stockName=#{stockName},stockFatherId=#{stockFatherId},stockType=#{stockType} where stockId=#{stockId}")
    int updateStock(StockEntity stockEntity);
}
